The present invention relates generally to data compression and more particularly to an apparatus and method for reducing the number of bits in a block of data generated during the operation of a data terminal device or other type of input peripheral device without losing the informational content of the data. In modern day on-line merchandising systems, a plurality of data terminal devices are each connected to a shared central processing unit (CPU) or other type of data collector for transmission thereto of data generated by the thermal device for processing to provide a basis for inventory and other business controls. During those periods where the CPU or the communication network to the CPU is inoperative for any reason it is the present practice to terminate the terminal operation or to provide a hard copy at the terminal from which the data can be recovered and transmitted to the CPU upon the recovery of the CPU to an operating condition. To insure the capture of data during periods when the CPU is inoperative, the hard copy backup operation is maintained as a normal part of the terminal operation when the CPU is operational. This requirement becomes an appreciative cost of terminal operations. In order to overcome this problem, it has been suggested that each data terminal include a memory unit to store the data generated during the time the CPU is disabled. Unfortunately, the data to be stored under these conditions can be so expensive as to make the in-terminal storage prohibitively expensive. This problem has been recognized in the prior art in which various methods and apparatuses have been devised to reduce the data in order to store it economically. For example, in U.S. Pat. No. 4,021,782, the data is compacted by varying the length and number base of the data. In U.S. Pat. Nos. 3,694,813, 3,717,851 and 3,925,780, data processing techniques using variable length codes to encode data in order to reduce the amount of data are disclosed. Since all of these techniques are directed to a central processor operations, their use in a stand-alone data terminal device would not be economically feasible. It is therefore a primary object of this invention to provide a low-cost data compression apparatus capable of reducing the amount of data generated in a data terminal device as the result of a plurality of merchandising operations sufficient to allow the terminal device to store the data without losing any transactional detail.